<?php

class ResultMySQLi extends mysqli_result implements DatabaseResult
{
    public function fetchAssoc()
    {
        return parent::fetch_assoc();
    }
    public function fetchNum()
    {
        return parent::fetch_row();
    }
    public function fetchAll()
    {
        $ret = array();
        while ($row = $this->fetch_assoc()) {
            if (isset($row['id'])) {
                $ret[$row['id']] = $row;
            } else {
                $ret[] = $row;
            }
        }
        return $ret;
    }
    public function numRows()
    {
        return $this->num_rows;
    }
}